'use strict';

/**
 * @ngdoc service
 * @name jgappApp.modulemap
 * @description
 * # modulemap
 * Service in the jgappApp.
 */

/*
如果列表长度大于8时候根据categoryType类别来显示不同的分类背景图和连接
如果列表长度小于8时候直接显示categoryType类别下来的小分类，并且根据iconUrl值为小分类配置背景图和连接
*/

angular.module('jgappApp')
    .factory('Modulemap', function () {
        var Modulemap = {}
        var modulemapArr = [{
            "Other": { //其他
                intro: "投标、业绩、证件",
                className: "icon_newtask",
                viewName: "userdefined/index"
            }
        }, {
                "Project": { //经营管理
                    intro: "投标、业绩、证件",
                    className: "icon_jy",
                    viewName: "manage/index"
                }
            }, {
                "Project_BidApply": { //投标申请单
                    className: "icon_tb",
                    viewName: "manage/tbapply",
                    checkViewName: "manage/checktbapply"
                }
            }, {
                "Chief_PerformanceApply": { //借业绩
                    className: "icon_lend",
                    viewName: "manage/lend",
                    checkViewName: "manage/check_lend"

                }
            }, {
                "Chief_PerformanceReturn": { //还业绩
                    className: "icon_repay",
                    viewName: "manage/repay",
                    checkViewName: "manage/check_reapy"
                }
            }, {
                "Chief_CertificateApplyNew": { //借证件
                    className: "icon_lendid",
                    viewName: "manage/lendid",
                    checkViewName: "manage/check_lendid"

                }
            }, {
                "Chief_CertificateReturn": { //还证件
                    className: "icon_repayid",
                    viewName: "manage/repayid",
                    checkViewName: "manage/check_reapyid"

                }
            }, {
                "Finance": { //财务管理
                    intro: "付款、收款、借款、报销等各种财务",
                    className: "icon_cw",
                    viewName: "finance/index"
                }
            }, {
                "Finance_BorrowMoney": { //借款单
                    className: "icon_jkd",
                    viewName: "finance/f_jkd",
                    checkViewName: "finance/checkf_jkd"
                }
            }, {
                "Finance_PayMoney": { //付款单
                    className: "icon_fkd",
                    viewName: "finance/f_fkd",
                    checkViewName: "finance/checkf_fkd"
                }
            }, {
                "Finance_OpenAccount": { //银行开户
                    className: "icon_yhkh",
                    viewName: "finance/f_yhkh",
                    checkViewName: "finance/checkf_yhkh"
                }
            }, {
                "Finance_BankGuarantee": { //银行保函
                    className: "icon_yhbh",
                    viewName: "finance/f_yhbh",
                    checkViewName: "finance/checkf_yhbh"
                }
            }, {
                "Chief_CertificateCost": { //证件费用
                    className: "icon_zjfy",
                    viewName: "finance/f_zjfy",
                    checkViewName: "finance/checkf_zjfy"
                }
            }, {
                "Finance_Reimbursement": { //报销单
                    className: "icon_bxd",
                    viewName: "finance/f_bxd",
                    checkViewName: "finance/checkf_bxd"
                }
            }, {
                "Finance_ProjectMoney": { //工程款
                    className: "icon_gck",
                    viewName: "finance/f_gck",
                    checkViewName: "finance/checkf_gck"
                }
            }, {
                "Finance_DepositApplySingle": { //保证金
                    className: "icon_bzj",
                    viewName: "finance/f_bzj",
                    checkViewName: "finance/checkf_bzj"
                }
            }, {
                "Finance_OtherMoney": { //收款
                    className: "icon_sk",
                    viewName: "finance/f_sk",
                    checkViewName: "finance/checkf_sk"
                }
            }, {
                "Finance_BcompanyCost": { //分公司收款
                    className: "icon_sk",
                    checkViewName: "finance/checkf_fgssk"
                }
            }, {
                "Finance_TaxReceiptRegister": { //工程税票
                    className: "icon_gcsp",
                    viewName: "finance/f_gcsp",
                    checkViewName: "finance/checkf_gcsp"
                }

            }, {
                "Finance_AddedValueTax": { //增值税发票
                    className: "icon_addtax",
                    viewName: "finance/addvaluetax",
                    checkViewName: "finance/check_addvaluetax"
                }
            }, {
                "Project_BidNotice": { //投标公示栏
                    className: "icon_newtask",
                    viewName: "manage/bidnotice",
                    checkViewName: "manage/check_bidnotice"
                }
            }, {
                "Finance_SendDepositApply": { //汇保证金
                    className: "icon_bzj",
                    viewName: "finance/SendDepositApply",
                    checkViewName: "finance/check_SendDepositApply"
                }
            }, {
                "Finance_BackDepositApply": { //退保证金
                    className: "icon_bzj",
                    viewName: "finance/BackDepositApply",
                    checkViewName: "finance/check_BackDepositApply"
                }
            }, {
                "Project_BidChargeSingle": { //投标费收款
                    className: "icon_yhsk",
                    viewName: "manage/bidcharge",
                    checkViewName: "finance/checkf_tbfsk"
                }
            }, {
                "Finance_ManagermentCharge": { //管理费收款
                    className: "icon_yhsk",
                    checkViewName: "finance/checkf_glfsk"
                }
            }, {
                "Finance_OutRun": { //外经证
                    className: "icon_wjz",
                    viewName: "finance/f_wjz",
                    checkViewName: "finance/checkf_wjz"
                }
            }, {
                "Personnel": { //人事管理
                    intro: "出差、请假、加班、调休等人事申请",
                    viewName: "personnel/index",
                    className: "icon_rs",
                }
            }, {
                "Personnel_TravelApply": { //出差条
                    className: "icon_cc",
                    viewName: "personnel/cctip",
                    checkViewName: "personnel/checkcctip"
                }
            }, {
                "Personnel_BdApply": { //补登条
                    className: "icon_bd",
                    viewName: "personnel/bdtip",
                    checkViewName: "personnel/checkbdtip"
                }
            }, {
                "Personnel_Leave": { //请假条
                    className: "icon_qj",
                    viewName: "personnel/qjtip",
                    checkViewName: "personnel/checkqjtip"
                }
            }, {
                "Personnel_SalaryApply": { //工资条
                    className: "icon_gz",
                    checkViewName: "personnel/checkgztip"
                }
            }, {
                "Project_CommisionApply": { //提成申请
                    className: "icon_tcsq",
                    viewName: "personnel/tcsqtip",
                    checkViewName: "personnel/checkyjtc"
                }
            }, {
                "Personnel_OvertimeApply": { //加班条
                    className: "icon_jb",
                    viewName: "personnel/jbtip",
                    checkViewName: "personnel/checkjbtip"
                }
            }, {
                "Personnel_DaysoffApply": { //补休条
                    className: "icon_tx",
                    viewName: "personnel/txtip",
                    checkViewName: "personnel/checktxtip",
                }
            }, {
                "Personnel_CaseRegister": { //案件登记
                    className: "icon_tx",
                    checkViewName: "personnel/checkandj",
                }
            }, {
                "Personnel_UseCar": { //用车申请
                    className: "icon_ycsq",
                    viewName: "personnel/ycsq",
                    checkViewName: "personnel/checkycsq",
                }
            },  {
                "Project_AttendanceApply": { //出场申请
                    className: "icon_newtask",
                    viewName: "personnel/ccsq",
                    checkViewName: "personnel/checkccsq",
                }
            }, {
                "Personnel_GoOut": { //外出办事
                    className: "icon_wcbs",
                    viewName: "personnel/wcbs",
                    checkViewName: "personnel/checkwcbs",
                }
            }, {
                "Chief": { //行政管理
                    intro: "通知发文、办消证件、印章相关",
                    className: "icon_xz",
                    viewName: "administrator/index"
                }
            }, {
                "Chief_CertificateDeal": { //办证件
                    className: "icon_bz",
                    viewName: "administrator/admin_bz",
                    checkViewName: "administrator/check_admin_bz"
                }
            }, {
                "Chief_ReturnSeal": { //还印章
                    className: "icon_hyz",
                    viewName: "administrator/admin_hyz",
                    checkViewName: "administrator/check_admin_hyz",
                }
            }, {
                "Chief_BorrowSeal": { //借印章
                    className: "icon_jyz",
                    viewName: "administrator/admin_jyz",
                    checkViewName: "administrator/check_admin_jyz",
                }
            }, {
                "Chief_CarveSeal": { //刻印章
                    className: "icon_kyz",
                    viewName: "administrator/admin_kyz",
                    checkViewName: "administrator/check_admin_kyz",
                }
            }, {
                "Chief_PublicDoc": { //通知发文
                    className: "icon_tzfw",
                    // viewName: "administrator/admin_tzfw",
                    checkViewName: "administrator/check_admin_tzfw",
                }
            }, {
                "Chief_DestorySeal": { //印章注销
                    className: "icon_yzzx",
                    // viewName: "administrator/admin_yzzx",
                    checkViewName: "administrator/check_admin_yzzx"
                }
            }, {
                "Chief_CertificateTransfer": { //证件转出注销
                    className: "icon_zjzczx",
                    viewName: "administrator/admin_zjzczx",
                    checkViewName: "administrator/check_admin_zjzczx"
                }
            }, {
                "Chief_UseSeal": { //用印登记
                    className: "icon_newtask",
                    viewName: "administrator/admin_yydj",
                    checkViewName: "administrator/check_admin_yydj"
                }
            }, {
                "Chief_CertificateShift": { //证件调配
                    className: "icon_zjdp",
                    viewName: "administrator/admin_zjdp",
                    checkViewName: "administrator/check_admin_zjdp"
                }
            }, {
                "Contract": { //合同管理
                    intro: "工程、证件、分公司合同",
                    className: "icon_ht",
                    viewName: "contract/index"
                }
            }, {
                "Project_ContractApplySingle": { //工程合同
                    className: "icon_ht1",
                    viewName: "contract/gccontract",
                    checkViewName: "contract/checkgccontract"
                }
            }, {
                "Chief_AgreementApply": { //证件合同
                    className: "icon_ht2",
                    viewName: "contract/zjcontract",
                    checkViewName: "contract/checkzjcontract"
                }
            }, {
                "Contract_BcompanyContract": { //分公司合同
                    className: "icon_ht3",
                    viewName: "contract/fgscontract",
                    checkViewName: "contract/checkfgscontract"
                }
            }, {
                "Other_CaduitObject": { //自定义流程
                    className: "icon_ht3",
                    viewName: "userdefined/userdefined",
                    checkViewName: "userdefined/check_userdefined"
                }
            }];
        Modulemap.modulemapArr = modulemapArr
        Modulemap.getViewNameAndIcon = function (name) {
            var obj = "";
            this.modulemapArr.forEach(function (item, index, key) {
                if (item[name]) {
                    obj = item[name]
                    return obj
                }
            });
            return obj
        }
        return Modulemap
    });
